/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */
package l1j.server.server.command.executor;

import java.util.StringTokenizer;

import l1j.server.GameServer.LanSecurityManager;
import l1j.server.server.model.Instance.L1PcInstance;

public class L1BlockIp_Remove implements L1CommandExecutor {
	public static L1CommandExecutor getInstance() {
		return new L1BlockIp_Remove();
	}

	private L1BlockIp_Remove() {
	}

	@Override
	public void execute(final L1PcInstance pc, final String cmdName, final String arg) {
		try {
			final StringTokenizer stringtokenizer = new StringTokenizer(arg);
			//IPを指定
			final String s1 = stringtokenizer.nextToken();

//			final BlockIp_temp temp  = GameServer.getInstance().getBlock(s1);

//			if(temp ==null){
//				System.out.println(s1+" 不在封鎖清單中。");
//				return;
//				LanSecurityManager.BANIPPACK.put(key, value)
//				GameServer.getInstance().setBlock(s1);
//				System.out.println(s1+" 已鎖定30分鐘。");
//			}else{
//				temp.clear();
				LanSecurityManager.BANIPPACK.remove(s1);
				System.out.println(s1+" 已解鎖。");
//			}
		} catch (final Exception e) {
			System.out.println("指令錯誤 :"+cmdName +" ip");
//			pc.sendPackets(new S_SystemMessage(cmdName+ " IP [ add | del ]請輸入。"));
		}
	}
}
